<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <button id='btn1'>点击我普通函数</button>
    <button id='btn2'>点击我剪头函数</button>

    <script>
        //切断了全局变量和window属性映射机制。

        b= 10 //window上添加b属性
        console.log(b) //10
        console.log(window.b) //10
       
        let a = 20
        console.log(a) //20
        console.log(window.a)  //undefined

    </script>
</body>

</html>